﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.CodeRush.StructuralParser;

namespace DX_SourceOutliner
{

    public class VisibilityByElementTypeProcessor : VisibilityProcessorBase
    {

        /// <summary>
        /// Initializes a new instance of the VisibilityByAccessibilityProcessor class.
        /// </summary>
        /// <param name="options"></param>
        public VisibilityByElementTypeProcessor(NodeOptions options)
            : base(options)
        {

        }

        protected override bool CheckNodeVisibility()
        {
            if (_source.Element == null) return true;

            switch (_source.Element.ElementType)
            {
                case LanguageElementType.Method:
                    return _options.ShowMethods;

                case LanguageElementType.Property:
                    return _options.ShowProperties;

                case LanguageElementType.Event:
                    return _options.ShowEvents;

                case LanguageElementType.Variable:
                case LanguageElementType.InitializedVariable:
                    return _options.ShowVariables;

                case LanguageElementType.Class:
                    return _options.ShowClasses;

                case LanguageElementType.Namespace:
                    return _options.ShowNamespaces;

                case LanguageElementType.Interface:
                    return _options.ShowInterfaces;

                case LanguageElementType.Delegate:
                    return _options.ShowDelegates;

                case LanguageElementType.Enum:
                case LanguageElementType.EnumElement:
                    return _options.ShowEnums;

                case LanguageElementType.Struct:
                    return _options.ShowStructs;

                default:
                    return true;
            }


        }
        

    }
}
